package cc.marcio.systems.seven.dao;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;

public class DaoFactory {

	private static SessionFactory SESSION_FACTORY;
	private static AnnotationConfiguration CONFIGURATION;
	static {
		CONFIGURATION = new AnnotationConfiguration();
		CONFIGURATION.configure();
		SESSION_FACTORY = CONFIGURATION.buildSessionFactory();
	}
	
	private static Session getSession() {
		return SESSION_FACTORY.openSession();
	}
	
	public static UserDao getUserDao() {
		return new UserDao(DaoFactory.getSession());
	}
	
	public static ContactDomDao getContactDomDao() {
		return new ContactDomDao(DaoFactory.getSession());
	}
	
	public static ContactDao getContactDao() {
		return new ContactDao(DaoFactory.getSession());
	}
	
	public static RoundDao getRoundDao() {
		return new RoundDao(DaoFactory.getSession());
	}
	
	public static PlanetDao getPlanetDao() {
		return new PlanetDao(DaoFactory.getSession());
	}

	public static MessageDao getMessageDao() {
		return new MessageDao(DaoFactory.getSession());
	}
	
	public static ActionDao getActionDao() {
		return new ActionDao(DaoFactory.getSession());
	}
}